package org.aspectsense.utilitydsl;
//$ANTLR 3.2 Sep 23, 2009 12:02:23 Utility.g 2010-01-28 15:03:46

import org.antlr.runtime.*;



import org.antlr.runtime.tree.*;

public class UtilityParser extends Parser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "PLUS", "MINUS", "MULT", "DIV", "LT", "LTE", "GT", "GTE", "EQ", "NEQ", "CONTEXT", "CONTEXT_ID", "UTILITY", "ID", "INT", "FLOAT", "EXPONENT", "WS", "'?'", "':'", "'('", "')'"
    };
    public static final int EXPONENT=20;
    public static final int LT=8;
    public static final int T__25=25;
    public static final int T__24=24;
    public static final int T__23=23;
    public static final int T__22=22;
    public static final int GTE=11;
    public static final int FLOAT=19;
    public static final int INT=18;
    public static final int MINUS=5;
    public static final int MULT=6;
    public static final int ID=17;
    public static final int EOF=-1;
    public static final int LTE=9;
    public static final int CONTEXT=14;
    public static final int WS=21;
    public static final int UTILITY=16;
    public static final int NEQ=13;
    public static final int CONTEXT_ID=15;
    public static final int GT=10;
    public static final int PLUS=4;
    public static final int DIV=7;
    public static final int EQ=12;

    // delegates
    // delegators


        public UtilityParser(TokenStream input) {
            this(input, new RecognizerSharedState());
        }
        public UtilityParser(TokenStream input, RecognizerSharedState state) {
            super(input, state);
             
        }
        
    protected TreeAdaptor adaptor = new CommonTreeAdaptor();

    public void setTreeAdaptor(TreeAdaptor adaptor) {
        this.adaptor = adaptor;
    }
    public TreeAdaptor getTreeAdaptor() {
        return adaptor;
    }

    public String[] getTokenNames() { return UtilityParser.tokenNames; }
    public String getGrammarFileName() { return "Utility.g"; }


    public static class prog_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "prog"
    // Utility.g:25:1: prog : ( stat )+ ;
    public final UtilityParser.prog_return prog() throws RecognitionException {
        UtilityParser.prog_return retval = new UtilityParser.prog_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        UtilityParser.stat_return stat1 = null;



        try {
            // Utility.g:25:11: ( ( stat )+ )
            // Utility.g:25:13: ( stat )+
            {
            root_0 = (CommonTree)adaptor.nil();

            // Utility.g:25:13: ( stat )+
            int cnt1=0;
            loop1:
            do {
                int alt1=2;
                int LA1_0 = input.LA(1);

                if ( (LA1_0==CONTEXT||LA1_0==UTILITY||(LA1_0>=INT && LA1_0<=FLOAT)||LA1_0==24) ) {
                    alt1=1;
                }


                switch (alt1) {
            	case 1 :
            	    // Utility.g:25:14: stat
            	    {
            	    pushFollow(FOLLOW_stat_in_prog137);
            	    stat1=stat();

            	    state._fsp--;

            	    adaptor.addChild(root_0, stat1.getTree());
            	    //System.out.println((stat1!=null?((CommonTree)stat1.tree):null).toStringTree());

            	    }
            	    break;

            	default :
            	    if ( cnt1 >= 1 ) break loop1;
                        EarlyExitException eee =
                            new EarlyExitException(1, input);
                        throw eee;
                }
                cnt1++;
            } while (true);


            }

            retval.stop = input.LT(-1);

            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "prog"

    public static class stat_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "stat"
    // Utility.g:28:1: stat : expr ( ( LT | LTE | GT | GTE | EQ | NEQ ) expr '?' expr ':' expr )? ;
    public final UtilityParser.stat_return stat() throws RecognitionException {
        UtilityParser.stat_return retval = new UtilityParser.stat_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        Token LT3=null;
        Token LTE4=null;
        Token GT5=null;
        Token GTE6=null;
        Token EQ7=null;
        Token NEQ8=null;
        Token char_literal10=null;
        Token char_literal12=null;
        UtilityParser.expr_return expr2 = null;

        UtilityParser.expr_return expr9 = null;

        UtilityParser.expr_return expr11 = null;

        UtilityParser.expr_return expr13 = null;


        CommonTree LT3_tree=null;
        CommonTree LTE4_tree=null;
        CommonTree GT5_tree=null;
        CommonTree GTE6_tree=null;
        CommonTree EQ7_tree=null;
        CommonTree NEQ8_tree=null;
        CommonTree char_literal10_tree=null;
        CommonTree char_literal12_tree=null;

        try {
            // Utility.g:28:12: ( expr ( ( LT | LTE | GT | GTE | EQ | NEQ ) expr '?' expr ':' expr )? )
            // Utility.g:28:14: expr ( ( LT | LTE | GT | GTE | EQ | NEQ ) expr '?' expr ':' expr )?
            {
            root_0 = (CommonTree)adaptor.nil();

            pushFollow(FOLLOW_expr_in_stat167);
            expr2=expr();

            state._fsp--;

            adaptor.addChild(root_0, expr2.getTree());
            // Utility.g:28:19: ( ( LT | LTE | GT | GTE | EQ | NEQ ) expr '?' expr ':' expr )?
            int alt3=2;
            int LA3_0 = input.LA(1);

            if ( ((LA3_0>=LT && LA3_0<=NEQ)) ) {
                alt3=1;
            }
            switch (alt3) {
                case 1 :
                    // Utility.g:28:21: ( LT | LTE | GT | GTE | EQ | NEQ ) expr '?' expr ':' expr
                    {
                    // Utility.g:28:21: ( LT | LTE | GT | GTE | EQ | NEQ )
                    int alt2=6;
                    switch ( input.LA(1) ) {
                    case LT:
                        {
                        alt2=1;
                        }
                        break;
                    case LTE:
                        {
                        alt2=2;
                        }
                        break;
                    case GT:
                        {
                        alt2=3;
                        }
                        break;
                    case GTE:
                        {
                        alt2=4;
                        }
                        break;
                    case EQ:
                        {
                        alt2=5;
                        }
                        break;
                    case NEQ:
                        {
                        alt2=6;
                        }
                        break;
                    default:
                        NoViableAltException nvae =
                            new NoViableAltException("", 2, 0, input);

                        throw nvae;
                    }

                    switch (alt2) {
                        case 1 :
                            // Utility.g:28:22: LT
                            {
                            LT3=(Token)match(input,LT,FOLLOW_LT_in_stat172); 
                            LT3_tree = (CommonTree)adaptor.create(LT3);
                            root_0 = (CommonTree)adaptor.becomeRoot(LT3_tree, root_0);


                            }
                            break;
                        case 2 :
                            // Utility.g:28:28: LTE
                            {
                            LTE4=(Token)match(input,LTE,FOLLOW_LTE_in_stat177); 
                            LTE4_tree = (CommonTree)adaptor.create(LTE4);
                            root_0 = (CommonTree)adaptor.becomeRoot(LTE4_tree, root_0);


                            }
                            break;
                        case 3 :
                            // Utility.g:28:35: GT
                            {
                            GT5=(Token)match(input,GT,FOLLOW_GT_in_stat182); 
                            GT5_tree = (CommonTree)adaptor.create(GT5);
                            root_0 = (CommonTree)adaptor.becomeRoot(GT5_tree, root_0);


                            }
                            break;
                        case 4 :
                            // Utility.g:28:41: GTE
                            {
                            GTE6=(Token)match(input,GTE,FOLLOW_GTE_in_stat187); 
                            GTE6_tree = (CommonTree)adaptor.create(GTE6);
                            root_0 = (CommonTree)adaptor.becomeRoot(GTE6_tree, root_0);


                            }
                            break;
                        case 5 :
                            // Utility.g:28:48: EQ
                            {
                            EQ7=(Token)match(input,EQ,FOLLOW_EQ_in_stat192); 
                            EQ7_tree = (CommonTree)adaptor.create(EQ7);
                            root_0 = (CommonTree)adaptor.becomeRoot(EQ7_tree, root_0);


                            }
                            break;
                        case 6 :
                            // Utility.g:28:54: NEQ
                            {
                            NEQ8=(Token)match(input,NEQ,FOLLOW_NEQ_in_stat197); 
                            NEQ8_tree = (CommonTree)adaptor.create(NEQ8);
                            root_0 = (CommonTree)adaptor.becomeRoot(NEQ8_tree, root_0);


                            }
                            break;

                    }

                    pushFollow(FOLLOW_expr_in_stat201);
                    expr9=expr();

                    state._fsp--;

                    adaptor.addChild(root_0, expr9.getTree());
                    char_literal10=(Token)match(input,22,FOLLOW_22_in_stat203); 
                    char_literal10_tree = (CommonTree)adaptor.create(char_literal10);
                    root_0 = (CommonTree)adaptor.becomeRoot(char_literal10_tree, root_0);

                    pushFollow(FOLLOW_expr_in_stat206);
                    expr11=expr();

                    state._fsp--;

                    adaptor.addChild(root_0, expr11.getTree());
                    char_literal12=(Token)match(input,23,FOLLOW_23_in_stat208); 
                    pushFollow(FOLLOW_expr_in_stat211);
                    expr13=expr();

                    state._fsp--;

                    adaptor.addChild(root_0, expr13.getTree());

                    }
                    break;

            }


            }

            retval.stop = input.LT(-1);

            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "stat"

    public static class expr_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "expr"
    // Utility.g:31:1: expr : part ( PLUS part | MINUS part )* ;
    public final UtilityParser.expr_return expr() throws RecognitionException {
        UtilityParser.expr_return retval = new UtilityParser.expr_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        Token PLUS15=null;
        Token MINUS17=null;
        UtilityParser.part_return part14 = null;

        UtilityParser.part_return part16 = null;

        UtilityParser.part_return part18 = null;


        CommonTree PLUS15_tree=null;
        CommonTree MINUS17_tree=null;

        try {
            // Utility.g:31:11: ( part ( PLUS part | MINUS part )* )
            // Utility.g:31:13: part ( PLUS part | MINUS part )*
            {
            root_0 = (CommonTree)adaptor.nil();

            pushFollow(FOLLOW_part_in_expr239);
            part14=part();

            state._fsp--;

            adaptor.addChild(root_0, part14.getTree());
            // Utility.g:31:18: ( PLUS part | MINUS part )*
            loop4:
            do {
                int alt4=3;
                int LA4_0 = input.LA(1);

                if ( (LA4_0==PLUS) ) {
                    alt4=1;
                }
                else if ( (LA4_0==MINUS) ) {
                    alt4=2;
                }


                switch (alt4) {
            	case 1 :
            	    // Utility.g:31:19: PLUS part
            	    {
            	    PLUS15=(Token)match(input,PLUS,FOLLOW_PLUS_in_expr242); 
            	    PLUS15_tree = (CommonTree)adaptor.create(PLUS15);
            	    root_0 = (CommonTree)adaptor.becomeRoot(PLUS15_tree, root_0);

            	    pushFollow(FOLLOW_part_in_expr245);
            	    part16=part();

            	    state._fsp--;

            	    adaptor.addChild(root_0, part16.getTree());

            	    }
            	    break;
            	case 2 :
            	    // Utility.g:31:32: MINUS part
            	    {
            	    MINUS17=(Token)match(input,MINUS,FOLLOW_MINUS_in_expr249); 
            	    MINUS17_tree = (CommonTree)adaptor.create(MINUS17);
            	    root_0 = (CommonTree)adaptor.becomeRoot(MINUS17_tree, root_0);

            	    pushFollow(FOLLOW_part_in_expr252);
            	    part18=part();

            	    state._fsp--;

            	    adaptor.addChild(root_0, part18.getTree());

            	    }
            	    break;

            	default :
            	    break loop4;
                }
            } while (true);


            }

            retval.stop = input.LT(-1);

            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "expr"

    public static class func_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "func"
    // Utility.g:34:1: func : ( CONTEXT '(' CONTEXT_ID ')' -> ^( CONTEXT CONTEXT_ID ) | UTILITY '(' ID ')' -> ^( UTILITY ID ) );
    public final UtilityParser.func_return func() throws RecognitionException {
        UtilityParser.func_return retval = new UtilityParser.func_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        Token CONTEXT19=null;
        Token char_literal20=null;
        Token CONTEXT_ID21=null;
        Token char_literal22=null;
        Token UTILITY23=null;
        Token char_literal24=null;
        Token ID25=null;
        Token char_literal26=null;

        CommonTree CONTEXT19_tree=null;
        CommonTree char_literal20_tree=null;
        CommonTree CONTEXT_ID21_tree=null;
        CommonTree char_literal22_tree=null;
        CommonTree UTILITY23_tree=null;
        CommonTree char_literal24_tree=null;
        CommonTree ID25_tree=null;
        CommonTree char_literal26_tree=null;
        RewriteRuleTokenStream stream_UTILITY=new RewriteRuleTokenStream(adaptor,"token UTILITY");
        RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID");
        RewriteRuleTokenStream stream_24=new RewriteRuleTokenStream(adaptor,"token 24");
        RewriteRuleTokenStream stream_25=new RewriteRuleTokenStream(adaptor,"token 25");
        RewriteRuleTokenStream stream_CONTEXT_ID=new RewriteRuleTokenStream(adaptor,"token CONTEXT_ID");
        RewriteRuleTokenStream stream_CONTEXT=new RewriteRuleTokenStream(adaptor,"token CONTEXT");

        try {
            // Utility.g:34:12: ( CONTEXT '(' CONTEXT_ID ')' -> ^( CONTEXT CONTEXT_ID ) | UTILITY '(' ID ')' -> ^( UTILITY ID ) )
            int alt5=2;
            int LA5_0 = input.LA(1);

            if ( (LA5_0==CONTEXT) ) {
                alt5=1;
            }
            else if ( (LA5_0==UTILITY) ) {
                alt5=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 5, 0, input);

                throw nvae;
            }
            switch (alt5) {
                case 1 :
                    // Utility.g:34:14: CONTEXT '(' CONTEXT_ID ')'
                    {
                    CONTEXT19=(Token)match(input,CONTEXT,FOLLOW_CONTEXT_in_func289);  
                    stream_CONTEXT.add(CONTEXT19);

                    char_literal20=(Token)match(input,24,FOLLOW_24_in_func291);  
                    stream_24.add(char_literal20);

                    CONTEXT_ID21=(Token)match(input,CONTEXT_ID,FOLLOW_CONTEXT_ID_in_func293);  
                    stream_CONTEXT_ID.add(CONTEXT_ID21);

                    char_literal22=(Token)match(input,25,FOLLOW_25_in_func295);  
                    stream_25.add(char_literal22);



                    // AST REWRITE
                    // elements: CONTEXT_ID, CONTEXT
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    // wildcard labels: 
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 34:41: -> ^( CONTEXT CONTEXT_ID )
                    {
                        // Utility.g:34:44: ^( CONTEXT CONTEXT_ID )
                        {
                        CommonTree root_1 = (CommonTree)adaptor.nil();
                        root_1 = (CommonTree)adaptor.becomeRoot(stream_CONTEXT.nextNode(), root_1);

                        adaptor.addChild(root_1, stream_CONTEXT_ID.nextNode());

                        adaptor.addChild(root_0, root_1);
                        }

                    }

                    retval.tree = root_0;
                    }
                    break;
                case 2 :
                    // Utility.g:35:9: UTILITY '(' ID ')'
                    {
                    UTILITY23=(Token)match(input,UTILITY,FOLLOW_UTILITY_in_func313);  
                    stream_UTILITY.add(UTILITY23);

                    char_literal24=(Token)match(input,24,FOLLOW_24_in_func315);  
                    stream_24.add(char_literal24);

                    ID25=(Token)match(input,ID,FOLLOW_ID_in_func317);  
                    stream_ID.add(ID25);

                    char_literal26=(Token)match(input,25,FOLLOW_25_in_func319);  
                    stream_25.add(char_literal26);



                    // AST REWRITE
                    // elements: UTILITY, ID
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    // wildcard labels: 
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 35:28: -> ^( UTILITY ID )
                    {
                        // Utility.g:35:31: ^( UTILITY ID )
                        {
                        CommonTree root_1 = (CommonTree)adaptor.nil();
                        root_1 = (CommonTree)adaptor.becomeRoot(stream_UTILITY.nextNode(), root_1);

                        adaptor.addChild(root_1, stream_ID.nextNode());

                        adaptor.addChild(root_0, root_1);
                        }

                    }

                    retval.tree = root_0;
                    }
                    break;

            }
            retval.stop = input.LT(-1);

            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "func"

    public static class part_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "part"
    // Utility.g:38:1: part : factor ( MULT factor | DIV factor )* ;
    public final UtilityParser.part_return part() throws RecognitionException {
        UtilityParser.part_return retval = new UtilityParser.part_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        Token MULT28=null;
        Token DIV30=null;
        UtilityParser.factor_return factor27 = null;

        UtilityParser.factor_return factor29 = null;

        UtilityParser.factor_return factor31 = null;


        CommonTree MULT28_tree=null;
        CommonTree DIV30_tree=null;

        try {
            // Utility.g:38:11: ( factor ( MULT factor | DIV factor )* )
            // Utility.g:38:13: factor ( MULT factor | DIV factor )*
            {
            root_0 = (CommonTree)adaptor.nil();

            pushFollow(FOLLOW_factor_in_part353);
            factor27=factor();

            state._fsp--;

            adaptor.addChild(root_0, factor27.getTree());
            // Utility.g:38:20: ( MULT factor | DIV factor )*
            loop6:
            do {
                int alt6=3;
                int LA6_0 = input.LA(1);

                if ( (LA6_0==MULT) ) {
                    alt6=1;
                }
                else if ( (LA6_0==DIV) ) {
                    alt6=2;
                }


                switch (alt6) {
            	case 1 :
            	    // Utility.g:38:21: MULT factor
            	    {
            	    MULT28=(Token)match(input,MULT,FOLLOW_MULT_in_part356); 
            	    MULT28_tree = (CommonTree)adaptor.create(MULT28);
            	    root_0 = (CommonTree)adaptor.becomeRoot(MULT28_tree, root_0);

            	    pushFollow(FOLLOW_factor_in_part359);
            	    factor29=factor();

            	    state._fsp--;

            	    adaptor.addChild(root_0, factor29.getTree());

            	    }
            	    break;
            	case 2 :
            	    // Utility.g:38:36: DIV factor
            	    {
            	    DIV30=(Token)match(input,DIV,FOLLOW_DIV_in_part363); 
            	    DIV30_tree = (CommonTree)adaptor.create(DIV30);
            	    root_0 = (CommonTree)adaptor.becomeRoot(DIV30_tree, root_0);

            	    pushFollow(FOLLOW_factor_in_part366);
            	    factor31=factor();

            	    state._fsp--;

            	    adaptor.addChild(root_0, factor31.getTree());

            	    }
            	    break;

            	default :
            	    break loop6;
                }
            } while (true);


            }

            retval.stop = input.LT(-1);

            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "part"

    public static class factor_return extends ParserRuleReturnScope {
        CommonTree tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "factor"
    // Utility.g:41:1: factor : ( INT | FLOAT | '(' expr ')' | func );
    public final UtilityParser.factor_return factor() throws RecognitionException {
        UtilityParser.factor_return retval = new UtilityParser.factor_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        Token INT32=null;
        Token FLOAT33=null;
        Token char_literal34=null;
        Token char_literal36=null;
        UtilityParser.expr_return expr35 = null;

        UtilityParser.func_return func37 = null;


        CommonTree INT32_tree=null;
        CommonTree FLOAT33_tree=null;
        CommonTree char_literal34_tree=null;
        CommonTree char_literal36_tree=null;

        try {
            // Utility.g:41:13: ( INT | FLOAT | '(' expr ')' | func )
            int alt7=4;
            switch ( input.LA(1) ) {
            case INT:
                {
                alt7=1;
                }
                break;
            case FLOAT:
                {
                alt7=2;
                }
                break;
            case 24:
                {
                alt7=3;
                }
                break;
            case CONTEXT:
            case UTILITY:
                {
                alt7=4;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 7, 0, input);

                throw nvae;
            }

            switch (alt7) {
                case 1 :
                    // Utility.g:41:14: INT
                    {
                    root_0 = (CommonTree)adaptor.nil();

                    INT32=(Token)match(input,INT,FOLLOW_INT_in_factor394); 
                    INT32_tree = (CommonTree)adaptor.create(INT32);
                    adaptor.addChild(root_0, INT32_tree);


                    }
                    break;
                case 2 :
                    // Utility.g:42:8: FLOAT
                    {
                    root_0 = (CommonTree)adaptor.nil();

                    FLOAT33=(Token)match(input,FLOAT,FOLLOW_FLOAT_in_factor404); 
                    FLOAT33_tree = (CommonTree)adaptor.create(FLOAT33);
                    adaptor.addChild(root_0, FLOAT33_tree);


                    }
                    break;
                case 3 :
                    // Utility.g:43:13: '(' expr ')'
                    {
                    root_0 = (CommonTree)adaptor.nil();

                    char_literal34=(Token)match(input,24,FOLLOW_24_in_factor418); 
                    pushFollow(FOLLOW_expr_in_factor421);
                    expr35=expr();

                    state._fsp--;

                    adaptor.addChild(root_0, expr35.getTree());
                    char_literal36=(Token)match(input,25,FOLLOW_25_in_factor423); 

                    }
                    break;
                case 4 :
                    // Utility.g:44:13: func
                    {
                    root_0 = (CommonTree)adaptor.nil();

                    pushFollow(FOLLOW_func_in_factor439);
                    func37=func();

                    state._fsp--;

                    adaptor.addChild(root_0, func37.getTree());

                    }
                    break;

            }
            retval.stop = input.LT(-1);

            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "factor"

    // Delegated rules


 

    public static final BitSet FOLLOW_stat_in_prog137 = new BitSet(new long[]{0x00000000010D4002L});
    public static final BitSet FOLLOW_expr_in_stat167 = new BitSet(new long[]{0x0000000000003F02L});
    public static final BitSet FOLLOW_LT_in_stat172 = new BitSet(new long[]{0x00000000014D4000L});
    public static final BitSet FOLLOW_LTE_in_stat177 = new BitSet(new long[]{0x00000000014D4000L});
    public static final BitSet FOLLOW_GT_in_stat182 = new BitSet(new long[]{0x00000000014D4000L});
    public static final BitSet FOLLOW_GTE_in_stat187 = new BitSet(new long[]{0x00000000014D4000L});
    public static final BitSet FOLLOW_EQ_in_stat192 = new BitSet(new long[]{0x00000000014D4000L});
    public static final BitSet FOLLOW_NEQ_in_stat197 = new BitSet(new long[]{0x00000000014D4000L});
    public static final BitSet FOLLOW_expr_in_stat201 = new BitSet(new long[]{0x0000000000400000L});
    public static final BitSet FOLLOW_22_in_stat203 = new BitSet(new long[]{0x00000000018D4000L});
    public static final BitSet FOLLOW_expr_in_stat206 = new BitSet(new long[]{0x0000000000800000L});
    public static final BitSet FOLLOW_23_in_stat208 = new BitSet(new long[]{0x00000000010D4000L});
    public static final BitSet FOLLOW_expr_in_stat211 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_part_in_expr239 = new BitSet(new long[]{0x0000000000000032L});
    public static final BitSet FOLLOW_PLUS_in_expr242 = new BitSet(new long[]{0x00000000010D4030L});
    public static final BitSet FOLLOW_part_in_expr245 = new BitSet(new long[]{0x0000000000000032L});
    public static final BitSet FOLLOW_MINUS_in_expr249 = new BitSet(new long[]{0x00000000010D4030L});
    public static final BitSet FOLLOW_part_in_expr252 = new BitSet(new long[]{0x0000000000000032L});
    public static final BitSet FOLLOW_CONTEXT_in_func289 = new BitSet(new long[]{0x0000000001000000L});
    public static final BitSet FOLLOW_24_in_func291 = new BitSet(new long[]{0x0000000000008000L});
    public static final BitSet FOLLOW_CONTEXT_ID_in_func293 = new BitSet(new long[]{0x0000000002000000L});
    public static final BitSet FOLLOW_25_in_func295 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_UTILITY_in_func313 = new BitSet(new long[]{0x0000000001000000L});
    public static final BitSet FOLLOW_24_in_func315 = new BitSet(new long[]{0x0000000000020000L});
    public static final BitSet FOLLOW_ID_in_func317 = new BitSet(new long[]{0x0000000002000000L});
    public static final BitSet FOLLOW_25_in_func319 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_factor_in_part353 = new BitSet(new long[]{0x00000000000000C2L});
    public static final BitSet FOLLOW_MULT_in_part356 = new BitSet(new long[]{0x00000000010D40C0L});
    public static final BitSet FOLLOW_factor_in_part359 = new BitSet(new long[]{0x00000000000000C2L});
    public static final BitSet FOLLOW_DIV_in_part363 = new BitSet(new long[]{0x00000000010D40C0L});
    public static final BitSet FOLLOW_factor_in_part366 = new BitSet(new long[]{0x00000000000000C2L});
    public static final BitSet FOLLOW_INT_in_factor394 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_FLOAT_in_factor404 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_24_in_factor418 = new BitSet(new long[]{0x00000000030D4000L});
    public static final BitSet FOLLOW_expr_in_factor421 = new BitSet(new long[]{0x0000000002000000L});
    public static final BitSet FOLLOW_25_in_factor423 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_func_in_factor439 = new BitSet(new long[]{0x0000000000000002L});

}